//
//  SMHOrderViewController.swift
//  SMHCommerce
//
//  Created by lvzhao on 2020/6/4.
//  Copyright © 2020 lvzhao. All rights reserved.
//

import UIKit

class SMHOrderViewController: LZBaseViewController ,UITableViewDelegate,UITableViewDataSource{
    var type :String?
    var status :Int?

    
    init(status:Int) {
        self.status = status
        super.init(nibName: nil, bundle: nil)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()

    }
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.view.addSubview(self.tableView)
        self.tableView.snp.makeConstraints { (make) in
            make.edges.equalTo(0)
        }
        let headView = UIView.init(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: 10))
        self.tableView.tableHeaderView = headView
    }
    
    
    //MARK:UITableViewDataSource
    func numberOfSections(in tableView: UITableView) -> Int {
        return 1
    }
    
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 40
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        
        let oderCell = tableView.dequeueReusableCell(withIdentifier: "SMHOrderCell", for: indexPath) as! SMHOrderCell
        oderCell.modelObject = "123" as AnyObject
        return oderCell
        
    }
    
    //MARK:懒加载
    lazy var tableView : LZBaseTableView = {
        let tableView = LZBaseTableView.init(frame: CGRect.zero, style: .grouped)
        tableView.delegate = self
        tableView.dataSource = self
        tableView.register(SMHOrderCell.self, forCellReuseIdentifier: "SMHOrderCell")
        tableView.rowHeight = 162
        tableView.separatorStyle = .none
        return tableView
    }()
    
    lazy var viewModel : SMHOrderViewModel = {
        let viewModel = SMHOrderViewModel()
        return viewModel
    }()
    
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
